For each function

To apply function like:

§          For each                  not native MDX function, implementation of MDX Generate function

 

available as axis function only you need to

§          … select with mouse desired row or column area and right-click with mouse

§          … select For each from menu

 

This function is useful if you have two hierarchies and on one of then or on both

you have applied function like for example TopCount.

 

 

In our case let us try to see:

 

Top 5 product subcategories FOR EACH of our Top 5 cities.

 

In upper result table you may see that we already prepared top 5 cities and top 5 subcategories.

Normally, the way SSAS server works we have same 5 subcategories for different cities.

To get specific top 5 subcategories counted by each city we have to apply For each function.

 

Dialog will appear:

 

 

§          select Ok

After confirmation result is:

 

 

Now, for each city we have different five subcategories.